import request from '@/utils/request'

export default {

  // 查询所有教练
  queryAll(){
    return request({
      url: `/coach/queryAll`,
      method: 'get',
    })
  },
  getList(currentPage,pageSize,name) {
    return request({
      url: `/coach/search/${currentPage}/${pageSize}`,
      method: 'post',
      data:name
    })
  },
  getDetailById(id) {
    return request({
      url: `/coach/detail/${id}`,
      method: 'get',
    })
  },
  getById(id) {
    return request({
      url: `/coach/label/${id}`,
      method: 'get',
    })
  },
  modify(coach,dynamicTags){
    return request({
      url: `/coach/${dynamicTags}`,
      method: 'put',
      data: coach
    })
  },
  delete(id){
    return request({
      url: `/coach/${id}`,
      method: 'delete',
    })
  },
  getName(){
    return request({
      url: `/coach/name`,
      method: 'get',
    })
  },

  getByGym(id){
    return request({
      url: `/coach/findByGym/${id}`,
      method: 'get',
    })
  },
  add(coach,dynamicTags){
    return request({
      url: `/coach/${dynamicTags}`,
      method: 'post',
      data: coach
    })
  }
}
